#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <iostream>
#define _clr(x,a) memset(x,a,sizeof(x));
using namespace std;
const int N=1205;
int n,d;
bool g[N][N];
double x[N];
double y[N];
int fa[N];
bool rep[N];
int find(int x){
    return fa[x]==x ? x : fa[x]=find(fa[x]);
}
void join(int a,int b){
    int ta=find(a);
    int tb=find(b);
    if(ta!=tb){
        fa[tb]=ta;
    }
}
double dis(int i,int j){
    return sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]))<=d;
}
int main(void){
    //freopen("data.txt","r",stdin);
    scanf("%d%d",&n,&d);
    for(int i=1;i<=n;i++){
        fa[i]=i;
        scanf("%lf%lf",&x[i],&y[i]);
    }
    for(int i=1;i<n;i++){
        for(int j=i+1;j<=n;j++){
            g[i][j]=g[j][i]=dis(i,j);
        }
    }
    getchar();
    char q;
    int a,b;
    while(cin >> q){
        if(q=='O'){
            scanf("%d",&a);
            rep[a]=true;
            for(int i=1;i<=n;i++){
                if(a==i || !rep[i]){
                    continue;
                }
                if(g[a][i]){
                    join(a,i);
                }
            }
        }
        else{
            scanf("%d%d",&b,&b);
            if(find(a)==find(b)){
                printf("SUCCESS\n");
            }
            else{
                printf("FAIL\n");
            }
        }
        getchar();
    }
    return 0;
}
